#!/bin/bash

CURRENT_PATH=$(dirname $(readlink -f $0))

declare -A FILE_R_MODE_MAP
declare -A FILE_MODE_MAP

FILE_R_MODE_MAP["${CURRENT_PATH}/../common"]="400"
FILE_R_MODE_MAP["${CURRENT_PATH}/inspection"]="400"

FILE_MODE_MAP["${CURRENT_PATH}/../common"]="755"
FILE_MODE_MAP["${CURRENT_PATH}/../common/script"]="755"
FILE_MODE_MAP["${CURRENT_PATH}/../common/script/logs_handler"]="755"
FILE_MODE_MAP["${CURRENT_PATH}/../common/script/logs_handler/logs_tool"]="700"
FILE_MODE_MAP["${CURRENT_PATH}/../common/script/logs_handler/do_compress_and_archive.py"]="440"
FILE_MODE_MAP["${CURRENT_PATH}/../common/script/log4sh.sh"]="440"
FILE_MODE_MAP["${CURRENT_PATH}"]="755"
FILE_MODE_MAP["${CURRENT_PATH}/appctl.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/backup.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/check_pwd.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/check_status.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/install.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/file_mod.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/log4sh.sh"]="440"
FILE_MODE_MAP["${CURRENT_PATH}/om_log_config.py"]="440"
FILE_MODE_MAP["${CURRENT_PATH}/om_log.py"]="440"
FILE_MODE_MAP["${CURRENT_PATH}/pre_install.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/start.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/stop.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/uninstall.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/get_config_info.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/env.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/config_params.json"]="640"
FILE_MODE_MAP["${CURRENT_PATH}/write_config.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/pre_upgrade.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/upgrade.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/upgrade_backup.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/upgrade_version_check.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/white_list.txt"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/rollback.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/get_source_version.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/clear_history_version.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/do_snapshot.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/rest_client.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/obtains_lsid.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/fetch_cls_stat.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/pre_upgrade.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/check_point.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/running_status_check.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/change_log_priority.sh"]="500"
FILE_MODE_MAP["${CURRENT_PATH}/clear_upgrade_backup.py"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/../deploy"]="755"
FILE_MODE_MAP["${CURRENT_PATH}/../deploy/deploy.log"]="640"
FILE_MODE_MAP["${CURRENT_PATH}/../config"]="755"
FILE_MODE_MAP["${CURRENT_PATH}/../config/backup_list.sh"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/../config/cantian.service"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/../config/cantian.timer"]="400"
FILE_MODE_MAP["${CURRENT_PATH}/../config/deploy_param.json"]="644"
FILE_MODE_MAP["${CURRENT_PATH}/../versions.yml"]="640"
FILE_MODE_MAP["${CURRENT_PATH}/inspection"]="750"
FILE_MODE_MAP["${CURRENT_PATH}/inspection/inspection_scripts"]="750"
FILE_MODE_MAP["${CURRENT_PATH}/inspection/inspection_scripts/cms"]="750"
FILE_MODE_MAP["${CURRENT_PATH}/inspection/inspection_scripts/kernal"]="750"
FILE_MODE_MAP["${CURRENT_PATH}/inspection/inspection_scripts/mysql"]="750"
FILE_MODE_MAP["${CURRENT_PATH}/inspection/inspection_scripts/ct_om"]="750"
FILE_MODE_MAP["${CURRENT_PATH}/inspection/log_tool.py"]="400"